#include<bits/stdc++.h>

using namespace std;
int main(){
    std::ios::sync_with_stdio(false);
    string a,b;
    b="chi1 huo3 guo1";
    getline(cin,a);
    int count=0,n=0,first=0;
    bool flag =true;
    while(a!="."){
        cout<<a;
        if(a.find(b)!=string::npos){
            count++;
            if(flag)
                first=n;
            flag=false;    
            }  
            n++;
            getline(cin,a);      
    }
    cout<<n<<"\n";
    if(count==0)
        cout<<"-_-#\n";
    else
        cout<<first<<" "<<count<<" ";
    return 0;
}